
RewriteOptions inherit
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"

# deal with admin first
RewriteCond %{REQUEST_URI} ^/(admin)
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
RewriteRule ^admin/images/(.*)$ backend/web/images/$1 [L]
RewriteRule ^admin/uploads/(.*)$ backend/web/uploads/$1 [L]
RewriteRule ^admin/downloads/(.*)$ backend/web/downloads/$1 [L]
RewriteRule ^admin/tmp/(.*)$ backend/web/tmp/$1 [L]

RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css|images|uploads|downloads|tmp)/
RewriteCond %{REQUEST_URI} ^/(admin)
RewriteRule ^.*$ backend/web/index.php [L]

RewriteCond %{REQUEST_URI} ^/(assets|css|images|uploads|downloads|tmp|qr)
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
RewriteRule ^images/(.*)$ frontend/web/images/$1 [L]
RewriteRule ^qr/(.*)$ frontend/web/qr/$1 [L]
RewriteRule ^uploads/(.*)$ frontend/web/uploads/$1 [L]

RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(images|assets|css|qr|uploads|downloads|tmp)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ frontend/web/index.php

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors On
   #php_value max_execution_time 30
   #php_value max_input_time 60
   php_value max_input_vars 1000
   #php_value memory_limit 64M
   #php_value post_max_size 8M
   #php_value session.gc_maxlifetime 1440
   #php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors On
   #php_value max_execution_time 30
   #php_value max_input_time 60
   php_value max_input_vars 1000
   #php_value memory_limit 64M
   #php_value post_max_size 8M
   #php_value session.gc_maxlifetime 1440
   #php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “nf-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-nf-php74___lsphp .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
